900 |
How do I get ride of the separator items when the user performs grouping
// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. void OnAddGroupItemGrid1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->GetItems()->PutItemDividerLine(Item,EXGRIDLib::EmptyLine); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExGrid\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spGrid1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spGrid1->PutSortBarVisible(VARIANT_TRUE); spGrid1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spGrid1->PutAllowGroupBy(VARIANT_TRUE); spGrid1->GetColumns()->GetItem(long(1))->PutSortOrder(EXGRIDLib::SortAscending); spGrid1->PutLinesAtRoot(EXGRIDLib::exGroupLinesOutside); spGrid1->EndUpdate(); |
899 |
How do I split a cell in three parts, and having a radio button in each of them
// CellStateChanged event - Fired after cell's state has been changed. void OnCellStateChangedGrid1(long Item,long ColIndex) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); OutputDebugStringW( spGrid1->GetItems()->GetCellCaption(Item,ColIndex) ); } // Click event - Occurs when the user presses and then releases the left mouse button over the grid control. void OnClickGrid1() { EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); long h = spGrid1->GetItemFromPoint(-1,-1,c,hit); spGrid1->GetItems()->PutCellState(h,c,1); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutFullRowSelect(EXGRIDLib::exColumnSel); spGrid1->PutSelBackColor(spGrid1->GetBackColor()); spGrid1->PutSelForeColor(spGrid1->GetForeColor()); spGrid1->PutDrawGridLines(EXGRIDLib::exAllLines); spGrid1->PutShowFocusRect(VARIANT_FALSE); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Default")))->PutDef(EXGRIDLib::exCellValueFormat,long(1)); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem("entire"); h = var_Items->AddItem("Radio <b>1"); var_Items->PutCellRadioGroup(h,long(0),100); var_Items->PutCellHasRadioButton(h,long(0),VARIANT_TRUE); var_Items->PutCellState(h,long(0),1); h = var_Items->GetSplitCell(h,long(0)); var_Items->PutCellValue(long(0),h,"Radio <b>2"); var_Items->PutCellRadioGroup(long(0),h,100); var_Items->PutCellHasRadioButton(long(0),h,VARIANT_TRUE); h = var_Items->GetSplitCell(long(0),h); var_Items->PutCellValue(long(0),h,"Radio <b>3"); var_Items->PutCellRadioGroup(long(0),h,100); var_Items->PutCellHasRadioButton(long(0),h,VARIANT_TRUE); h = var_Items->AddItem("entire"); spGrid1->EndUpdate(); |
898 |
Does your grid include a row indicator , like an arrow, bullet
// SelectionChanged event - Fired after a new item has been selected. void OnSelectionChangedGrid1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long hFocusItem = var_Items->GetFocusItem(); var_Items->PutCellValue(spGrid1->GetColumns()->GetItem("active")->GetData(),"active",""); var_Items->PutCellValue(hFocusItem,"active","<c><font symbol>·"); var_Items->PutCellVAlignment(hFocusItem,"active",EXGRIDLib::exBottom); spGrid1->GetColumns()->GetItem("active")->PutData(hFocusItem); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExGrid\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spGrid1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spGrid1->PutShowFocusRect(VARIANT_FALSE); spGrid1->PutContinueColumnScroll(VARIANT_TRUE); spGrid1->PutScrollBySingleLine(VARIANT_TRUE); spGrid1->PutAutoDrag(EXGRIDLib::AutoDragEnum(EXGRIDLib::exAutoDragScrollOnShortTouch | EXGRIDLib::exAutoDragScroll)); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L""))); var_Column->PutKey(L"active"); var_Column->PutPosition(0); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutWidth(12); var_Column->PutData(spGrid1->GetItems()->GetFocusItem()); var_Column->PutDef(EXGRIDLib::exCellValueFormat,long(1)); spGrid1->PutCountLockedColumns(1); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutSelectItem(var_Items->GetNextVisibleItem(var_Items->GetFocusItem()),VARIANT_TRUE); spGrid1->EndUpdate(); |
897 |
How can I connect to a DBF file
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutColumnAutoResize(VARIANT_FALSE); spGrid1->PutContinueColumnScroll(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADODB.Recordset"); rs->Open("Select * From foxcode.DBF","Provider=vfpoledb;Data Source=C:\\Program Files\\Microsoft Visual FoxPro 9\\",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spGrid1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); |
896 |
Does your control supports scrolling by touching the screen
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExGrid\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spGrid1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spGrid1->PutContinueColumnScroll(VARIANT_TRUE); spGrid1->PutScrollBySingleLine(VARIANT_TRUE); spGrid1->PutAutoDrag(EXGRIDLib::AutoDragEnum(EXGRIDLib::exAutoDragScrollOnShortTouch | EXGRIDLib::exAutoDragScroll)); |
895 |
How do I prevent showing the control's BackColorAlternate property on empty / non-items part of the control
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutBackColorAlternate(0x7ff0f0f0); spGrid1->GetColumns()->Add(L"Column"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("Item 1"); var_Items->AddItem("Item 2"); var_Items->AddItem("Item 3"); var_Items->AddItem("Item 4"); var_Items->AddItem("Item 5"); spGrid1->EndUpdate(); |
894 |
Is there any method for reading information from the root item for the current item...
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutLinesAtRoot(EXGRIDLib::exLinesAtRoot); spGrid1->PutSearchColumnIndex(0); spGrid1->GetColumns()->Add(L"Info"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutPathSeparator(L" ; "); var_Items->PutSelectItem(var_Items->InsertItem(var_Items->InsertItem(var_Items->InsertItem(var_Items->InsertItem(vtMissing,vtMissing,"Root"),vtMissing,"Child"),vtMissing,"Sub-Child"),vtMissing,"Sub-Sub-Child"),VARIANT_TRUE); var_Items->PutExpandItem(0,VARIANT_TRUE); OutputDebugStringW( var_Items->GetFullPath(var_Items->GetFocusItem()) ); spGrid1->EndUpdate(); |
893 |
How can I highlight items with a specified date
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); var_Columns->Add(L"Tasks"); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Date"))); var_Column->PutSortType(EXGRIDLib::SortDate); var_Column->GetEditor()->PutEditType(EXGRIDLib::SpinType); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutCellValue(var_Items->AddItem("Task 1"),long(1),COleDateTime(2001,12,13,0,00,00).operator DATE()); var_Items->PutCellValue(var_Items->AddItem("Task 2"),long(1),COleDateTime(2001,12,14,0,00,00).operator DATE()); var_Items->PutCellValue(var_Items->AddItem("Task 2"),long(1),COleDateTime(2001,12,15,0,00,00).operator DATE()); spGrid1->GetConditionalFormats()->Add(L"%1 = #12/14/2001#",vtMissing)->PutBold(VARIANT_TRUE); spGrid1->EndUpdate(); |
892 |
Today date is shown, if we use the Column.FormatColumn and Editor.Option(exDateAllowNullDate) properties. What can be done
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Date"))); var_Column->PutFormatColumn(_bstr_t("len(value) ? ( (longdate(date(value)) left 3) + ' ' + day(date(value)) + '/' + month(date(value)) + '/' + (year(date(value)) ri") + "ght 2) ) : '' )"); EXGRIDLib::IEditorPtr var_Editor = var_Column->GetEditor(); var_Editor->PutEditType(EXGRIDLib::DateType); var_Editor->PutOption(EXGRIDLib::exDateAllowNullDate,VARIANT_TRUE); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem(COleDateTime(2012,5,12,0,00,00).operator DATE()); var_Items->AddItem(vtMissing); var_Items->AddItem(COleDateTime(2012,5,14,0,00,00).operator DATE()); spGrid1->EndUpdate(); |
891 |
How can I add multiple values/columns on the same line/item/row
// Change event - Occurs when the user changes the cell's content. void OnChangeGrid1(long Item,long ColIndex,VARIANT FAR* NewValue) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->Refresh(); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutSortOnClick(EXGRIDLib::exNoSort); spGrid1->PutLinesAtRoot(EXGRIDLib::exGroupLinesOutside); spGrid1->PutIndent(13); spGrid1->PutHeaderVisible(VARIANT_FALSE); spGrid1->PutLinesAtRoot(EXGRIDLib::exLinesAtRoot); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); var_Columns->Add(L"Items"); ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Quantity")))->GetEditor()->PutEditType(EXGRIDLib::SpinType); ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Value")))->GetEditor()->PutEditType(EXGRIDLib::SpinType); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem("Items"); var_Items->PutCellValue(h,long(2),"sum(current,dir,dbl(%1)*dbl(%2))"); var_Items->PutCellValueFormat(h,long(2),EXGRIDLib::exTotalField); var_Items->PutFormatCell(h,long(2),L"`Total: `+ value"); var_Items->PutCellHAlignment(h,long(2),EXGRIDLib::RightAlignment); var_Items->PutCellBold(h,long(2),VARIANT_TRUE); var_Items->PutCellEditorVisible(h,long(2),EXGRIDLib::exEditorHidden); var_Items->PutCellEditorVisible(h,long(1),EXGRIDLib::exEditorHidden); long h1 = var_Items->InsertItem(h,vtMissing,"Item 1"); var_Items->PutCellValue(h1,long(1),long(10)); var_Items->PutCellValue(h1,long(2),long(3)); h1 = var_Items->InsertItem(h,vtMissing,"Item 2"); var_Items->PutCellValue(h1,long(1),long(20)); var_Items->PutCellValue(h1,long(2),long(4)); var_Items->PutExpandItem(h,VARIANT_TRUE); spGrid1->EndUpdate(); |
890 |
Is there a syntax for conditional formatting of items, based on CellState/CellStateChange
// CellStateChanged event - Fired after cell's state has been changed. void OnCellStateChangedGrid1(long Item,long ColIndex) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutCellValue(Item,long(2),var_Items->GetCellState(Item,long(0))); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutShowFocusRect(VARIANT_FALSE); spGrid1->PutSelBackMode(EXGRIDLib::exTransparent); EXGRIDLib::IConditionalFormatPtr var_ConditionalFormat = spGrid1->GetConditionalFormats()->Add(L"%2 != 0",vtMissing); var_ConditionalFormat->PutBold(VARIANT_TRUE); var_ConditionalFormat->PutForeColor(RGB(255,0,0)); var_ConditionalFormat->PutApplyTo(EXGRIDLib::exFormatToItems); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L""))); var_Column->PutDef(EXGRIDLib::exCellHasCheckBox,VARIANT_TRUE); var_Column->PutWidth(16); var_Column->PutAllowSizing(VARIANT_FALSE); spGrid1->GetColumns()->Add(L"Information"); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Hidden")))->PutVisible(VARIANT_FALSE); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutCellValue(var_Items->AddItem(""),long(1),"This is a bit of text associated"); long h = var_Items->AddItem(""); var_Items->PutCellValue(h,long(1),"This is a bit of text associated"); var_Items->PutCellState(h,long(0),1); var_Items->PutCellValue(var_Items->AddItem(""),long(1),"This is a bit of text associated"); spGrid1->EndUpdate(); |
889 |
How do I programatically focus a cell
// FocusChanged event - Occurs when a new cell is focused. void OnFocusChangedGrid1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutCellBackColor(var_Items->GetFocusItem(),spGrid1->GetFocusColumnIndex(),RGB(255,0,0)); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutSelForeColor(spGrid1->GetForeColor()); spGrid1->PutSelBackColor(spGrid1->GetBackColor()); spGrid1->PutDrawGridLines(EXGRIDLib::exRowLines); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); var_Columns->Add(L"Column1"); var_Columns->Add(L"Column2"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutCellValue(var_Items->AddItem("Cell 1.1"),long(1),"Cell 1.2"); var_Items->PutCellValue(var_Items->AddItem("Cell 2.1"),long(1),"Cell 2.2"); EXGRIDLib::IItemsPtr var_Items1 = spGrid1->GetItems(); var_Items1->PutSelectItem(var_Items1->GetItemByIndex(1),VARIANT_TRUE); spGrid1->PutFocusColumnIndex(1); spGrid1->EndUpdate(); |
888 |
How do I programatically focus a cell (excrd)
// FocusChanged event - Occurs when a new cell is focused. void OnFocusChangedGrid1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutCellBackColor(var_Items->GetFocusItem(),spGrid1->GetFocusColumnIndex(),RGB(255,0,0)); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutSelForeColor(spGrid1->GetForeColor()); spGrid1->PutSelBackColor(spGrid1->GetBackColor()); spGrid1->PutDrawGridLines(EXGRIDLib::exRowLines); spGrid1->PutDefaultItemHeight(36); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Column1")))->PutVisible(VARIANT_FALSE); ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Column2")))->PutVisible(VARIANT_FALSE); ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Column3")))->PutVisible(VARIANT_FALSE); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"FormatLevel"))); var_Column->PutFormatLevel(L"(0/1),2"); var_Column->PutDef(EXGRIDLib::exCellFormatLevel,var_Column->GetFormatLevel()); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem("Cell 1.1"); var_Items->PutCellValue(h,long(1),"Cell 1.2"); var_Items->PutCellValue(h,long(2),"Cell 1.3"); h = var_Items->AddItem("Cell 2.1"); var_Items->PutCellValue(h,long(1),"Cell 2.2"); var_Items->PutCellValue(h,long(2),"Cell 2.3"); EXGRIDLib::IItemsPtr var_Items1 = spGrid1->GetItems(); var_Items1->PutSelectItem(var_Items1->GetItemByIndex(1),VARIANT_TRUE); spGrid1->PutFocusColumnIndex(2); spGrid1->EndUpdate(); |
887 |
How do I programmatically exclude items from the filter
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutLinesAtRoot(EXGRIDLib::exLinesAtRoot); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Items"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutFilterList(EXGRIDLib::FilterListEnum(EXGRIDLib::exShowExclude | EXGRIDLib::exShowFocusItem | EXGRIDLib::exShowCheckBox)); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("Item 1"); var_Items->AddItem("Item 2"); var_Items->AddItem("Item 3"); var_Items->AddItem("Item 4"); EXGRIDLib::IColumnPtr var_Column1 = spGrid1->GetColumns()->GetItem(long(0)); var_Column1->PutFilterType(EXGRIDLib::FilterTypeEnum(EXGRIDLib::exFilterExclude | EXGRIDLib::exFilter)); var_Column1->PutFilter(L"Item 1|Item 4"); spGrid1->ApplyFilter(); spGrid1->EndUpdate(); |
886 |
Using the property Column.FormatColumn I want to display numbers in the numeric format with no decimals - unless the value is NULL then I want to display a blank or empty
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Format")))->PutFormatColumn(L"len(value) ? (value format '0') : '' "); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem(long(10)); var_Items->AddItem(vtMissing); var_Items->AddItem(long(-8)); spGrid1->EndUpdate(); |
885 |
How can I change the drop down filter background color
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutLinesAtRoot(EXGRIDLib::exLinesAtRoot); spGrid1->PutBackground(EXGRIDLib::exBackColorFilter,RGB(255,255,255)); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Items"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutFilterList(EXGRIDLib::FilterListEnum(EXGRIDLib::exShowFocusItem | EXGRIDLib::exShowCheckBox | EXGRIDLib::exSortItemsAsc | EXGRIDLib::exLeafItems)); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->InsertItem(h,vtMissing,"Child 3"); var_Items->PutExpandItem(h,VARIANT_TRUE); spGrid1->EndUpdate(); |
884 |
I am using AllowGroupBy property and calling the Column.SortOrder property groups by that column. Is it possible to prevent that, so I have a similar behavior like I click the column's header rather than dragging it to the control's GroupBy bar
|
883 |
Calling programatically the Column.SortOrder property adds the column to the sort bar. Is it possible to prevent that, so I have a similar behavior like I click the column's header rather than dragging it to the control's Sort bar
|
882 |
How do I restore/clear the HotBackColor/HotForeColor properties
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutHotBackColor(RGB(0,0,255)); spGrid1->PutHotForeColor(RGB(255,255,255)); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Value")))->PutVisible(VARIANT_FALSE); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"USD"))); var_Column->PutDef(EXGRIDLib::exCellValueFormat,long(1)); var_Column->PutFormatColumn(L"len(%0) ? ((0:=dbl(%0)) < 10 ? '<fgcolor=808080><font ;7>' : '<b>') + `USD `+ (=:0 format ``)"); EXGRIDLib::IColumnPtr var_Column1 = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"EUR"))); var_Column1->PutDef(EXGRIDLib::exCellValueFormat,long(1)); var_Column1->PutFormatColumn(L"len(%0) ? ((0:=0.72*dbl(%0)) < 10 ? '<fgcolor=808080><font ;7>' : '<b>') + `EUR `+ (=:0 format ``)"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("1.23"); var_Items->AddItem("2.34"); var_Items->AddItem("9.94"); var_Items->AddItem("11.94"); var_Items->AddItem("1000"); spGrid1->PutHotBackColor(spGrid1->GetBackColor()); spGrid1->PutHotForeColor(spGrid1->GetForeColor()); spGrid1->EndUpdate(); |
881 |
How do I format a column using a currency, and another column to another currency
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Value")))->PutVisible(VARIANT_FALSE); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"USD"))); var_Column->PutDef(EXGRIDLib::exCellValueFormat,long(1)); var_Column->PutFormatColumn(L"len(%0) ? ((0:=dbl(%0)) < 10 ? '<fgcolor=808080><font ;7>' : '<b>') + `USD `+ (=:0 format ``)"); EXGRIDLib::IColumnPtr var_Column1 = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"EUR"))); var_Column1->PutDef(EXGRIDLib::exCellValueFormat,long(1)); var_Column1->PutFormatColumn(L"len(%0) ? ((0:=0.72*dbl(%0)) < 10 ? '<fgcolor=808080><font ;7>' : '<b>') + `EUR `+ (=:0 format ``)"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("1.23"); var_Items->AddItem("2.34"); var_Items->AddItem("9.94"); var_Items->AddItem("11.94"); var_Items->AddItem("1000"); |
880 |
How can I sort the columns to be displayed on the columns floating bar
|
879 |
How can I get the column index and the row index of the active cell
// FocusChanged event - Occurs when a new cell is focused. void OnFocusChangedGrid1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); OutputDebugStringW( L"Active/Focus-Column:" ); OutputDebugStringW( spGrid1->GetColumns()->GetItem(spGrid1->GetFocusColumnIndex())->GetCaption() ); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); OutputDebugStringW( L"Active/Focus-Row/Item:" ); OutputDebugStringW( var_Items->GetCellCaption(var_Items->GetFocusItem(),spGrid1->GetFocusColumnIndex()) ); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"C1")))->GetEditor()->PutEditType(EXGRIDLib::EditType); ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"C2")))->GetEditor()->PutEditType(EXGRIDLib::EditType); ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"C3")))->GetEditor()->PutEditType(EXGRIDLib::EditType); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem(long(1)); var_Items->PutCellValue(h,long(1),long(2)); var_Items->PutCellValue(h,long(2),long(3)); h = var_Items->AddItem(long(3)); var_Items->PutCellValue(h,long(1),long(1)); var_Items->PutCellValue(h,long(2),long(2)); spGrid1->EndUpdate(); |
878 |
How can I add a vertical padding
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutDrawGridLines(EXGRIDLib::exAllLines); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Padding"))); var_Column->PutDef(EXGRIDLib::exCellHasCheckBox,VARIANT_TRUE); var_Column->PutDef(EXGRIDLib::exCellSingleLine,VARIANT_FALSE); var_Column->PutDef(EXGRIDLib::exCellPaddingLeft,long(6)); var_Column->PutDef(EXGRIDLib::exCellPaddingRight,long(6)); var_Column->PutDef(EXGRIDLib::exCellPaddingTop,long(6)); var_Column->PutDef(EXGRIDLib::exCellPaddingBottom,long(6)); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("padding"); var_Items->AddItem("padding"); spGrid1->EndUpdate(); |
877 |
How can I set item's height individually for every item in the control and also have line breaks in the item caption
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutBackColorAlternate(RGB(240,240,240)); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Lines"))); var_Column->PutDef(EXGRIDLib::exCellValueFormat,long(1)); var_Column->PutDef(EXGRIDLib::exCellSingleLine,VARIANT_FALSE); spGrid1->PutItemsAllowSizing(EXGRIDLib::exResizeItem); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem("Line 1<br>Line 2"); var_Items->PutItemMinHeight(h,36); var_Items->PutItemHeight(h,var_Items->GetItemMinHeight(h)); var_Items->PutItemMaxHeight(h,var_Items->GetItemMinHeight(h)); h = var_Items->AddItem("Line 1<br>Line 2"); var_Items->PutItemMinHeight(h,48); var_Items->PutItemHeight(h,var_Items->GetItemMinHeight(h)); var_Items->PutItemMaxHeight(h,var_Items->GetItemMinHeight(h)); h = var_Items->AddItem("Line 1<br>Line 2"); var_Items->PutItemMinHeight(h,64); var_Items->PutItemHeight(h,var_Items->GetItemMinHeight(h)); var_Items->PutItemMaxHeight(h,var_Items->GetItemMinHeight(h)); |
876 |
The mouse-cursor is shown over the tooltip. Is it possible somehow resolve this (method 2)
// MouseMove event - Occurs when the user moves the mouse. void OnMouseMoveGrid1(short Button,short Shift,long X,long Y) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->ShowToolTip(L"This is bit of text that's shown when the user hovers the cell","Column",long(0),"+16","+16"); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->GetColumns()->Add(L"Column"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("tooltip"); |
875 |
The mouse-cursor is shown over the tooltip. Is it possible somehow resolve this (method 1)
|
874 |
How can I add a MIN or MAX field (for date)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Text")))->PutSortType(EXGRIDLib::SortDate); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(1998,12,11,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2014,1,20,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2013,1,1,0,00,00).operator DATE()); long h = var_Items->AddItem("min(all,dir,date(%0))"); var_Items->PutSortableItem(h,VARIANT_FALSE); var_Items->PutCellValueFormat(h,long(0),EXGRIDLib::exTotalField); var_Items->PutCellHAlignment(h,long(0),EXGRIDLib::RightAlignment); var_Items->PutFormatCell(h,long(0),L"'MIN: '+value"); h = var_Items->AddItem("max(all,dir,date(%0))"); var_Items->PutSortableItem(h,VARIANT_FALSE); var_Items->PutCellValueFormat(h,long(0),EXGRIDLib::exTotalField); var_Items->PutCellHAlignment(h,long(0),EXGRIDLib::RightAlignment); var_Items->PutFormatCell(h,long(0),L"'MAX: '+value"); spGrid1->EndUpdate(); |
873 |
How can I add a MIN or MAX field (for text)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Text")))->PutSortType(EXGRIDLib::SortString); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("aha"); var_Items->AddItem("baba"); var_Items->AddItem("aaha"); var_Items->AddItem("aka"); long h = var_Items->AddItem("min(all,dir,str(%0))"); var_Items->PutSortableItem(h,VARIANT_FALSE); var_Items->PutCellValueFormat(h,long(0),EXGRIDLib::exTotalField); var_Items->PutCellHAlignment(h,long(0),EXGRIDLib::RightAlignment); var_Items->PutFormatCell(h,long(0),L"'MIN: '+value"); h = var_Items->AddItem("max(all,dir,str(%0))"); var_Items->PutSortableItem(h,VARIANT_FALSE); var_Items->PutCellValueFormat(h,long(0),EXGRIDLib::exTotalField); var_Items->PutCellHAlignment(h,long(0),EXGRIDLib::RightAlignment); var_Items->PutFormatCell(h,long(0),L"'MAX: '+value"); spGrid1->EndUpdate(); |
872 |
How can I change the the focus rectangle
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->GetVisualAppearance()->Add(1,_bstr_t("gBFLBCJwBAEHhEJAAEhABeEGACAADACAxRDgMQBQKAAzQFAYbBlBaERiGQYIJhUAIIRZGMQxXAcMQvDSKQJhGDAADENAxAJCI4DBIgZQNDwZQIkCY4ZDKHIfRzNAASJ") + "IkTQPBKfYDGOLhSh6IJGRpPEIxdJMBr+fZ9QApeoYVj2J4eUCAFBxDRsZw8BiNAbkOi4Jp1f5nVJaFSxCKoSxbNqSBpGCzoJrKdI0R5JES2BAddTLBKzX7tHArLgSJ5d" + "SrLMrwSKcRR1HSbIDyGaMUiCSqGVjWNZ5FREM46AAGbDgMILEgOZpoYDFVTZTKFCS7I6Eb40CCbCyPJQAabgWo4KAAZThNi7QAua4bTr7HqibLAexaJDOc4HVSgMLlIY" + "EkIeg2iybAjDkfhMFuHY7mQT4xB0TBnFoUQ6i+cg2j2SIvHqVZIl8cB+BwTgPA4NRdjycg2FoHhuAMUZuHGUAwCECQUAaEYMHQHRHCGFRZEQAABO2AwRFCWQJAoGxECW" + "TBHkGBxpg8RhYBMbJbD+TBzByfwwAwCIOCWCQiGiJgogqYh4hYIQ/k2cx9gEYQAAiRgqgsYx4mYLIOiOCMjjCTA4iScw8mMOQWEaEZkGkDgpguUIYm4SITmUCQaDuExj" + "gkRhWhQJQ0A4ToVmWSQWFkAAljkdhiheZgZgoXIZCUWYaF2GgihmKhrg4JRJjYboVmaSIiHOHQnAkahph2ZYJmQAAxAwSQKESHwkFkKgoiAIxIHoPIimOOg2DiCgoiQJ" + "RQTYQxwn8MgMgoMoPiaYoaGCfw4A4CJNAkOpcGQBCAg=="); spGrid1->PutBackground(EXGRIDLib::exShowFocusRect,0x1000000); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Check"))); var_Column->PutDef(EXGRIDLib::exCellPaddingLeft,long(2)); var_Column->PutDef(EXGRIDLib::exCellHasCheckBox,VARIANT_TRUE); spGrid1->PutSelForeColor(spGrid1->GetForeColor()); spGrid1->PutSelBackColor(spGrid1->GetBackColor()); spGrid1->PutDefaultItemHeight(22); spGrid1->PutShowFocusRect(VARIANT_TRUE); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem(""); var_Items->AddItem(""); spGrid1->EndUpdate(); |
871 |
Can each cell have their own dropdown lists that contain "different list item values" for each cell, not predefined for the entire column
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); EXGRIDLib::IEditorPtr var_Editor = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Column/Cell-Same")))->GetEditor(); var_Editor->PutEditType(EXGRIDLib::DropDownListType); var_Editor->AddItem(0,L"Zero",vtMissing); var_Editor->AddItem(1,L"One",vtMissing); var_Editor->AddItem(2,L"Two",vtMissing); EXGRIDLib::IEditorPtr var_Editor1 = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Column/Cell-Different")))->GetEditor(); var_Editor1->PutEditType(EXGRIDLib::EditType); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem(vtMissing); long h = var_Items->AddItem(long(0)); EXGRIDLib::IEditorPtr var_Editor2 = var_Items->GetCellEditor(h,long(1)); var_Editor2->PutEditType(EXGRIDLib::DropDownListType); var_Editor2->AddItem(3,L"Three",vtMissing); var_Editor2->AddItem(4,L"Four",vtMissing); var_Items->PutCellValue(h,long(1),long(3)); var_Items->AddItem(vtMissing); h = var_Items->AddItem(long(0)); EXGRIDLib::IEditorPtr var_Editor3 = var_Items->GetCellEditor(h,long(1)); var_Editor3->PutEditType(EXGRIDLib::CheckListType); var_Editor3->AddItem(1,L"Single",vtMissing); var_Editor3->AddItem(2,L"Double",vtMissing); var_Items->PutCellValue(h,long(1),long(3)); spGrid1->EndUpdate(); |
870 |
How can I specify just a few fonts in a FontType editor
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutDefaultItemHeight(22); spGrid1->PutDrawGridLines(EXGRIDLib::exRowLines); EXGRIDLib::IEditorPtr var_Editor = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Fonts")))->GetEditor(); var_Editor->PutEditType(EXGRIDLib::FontType); var_Editor->ClearItems(); var_Editor->AddItem(0,L"Calibri",vtMissing); var_Editor->AddItem(1,L"Arial",vtMissing); var_Editor->AddItem(2,L"Rockwell",vtMissing); var_Editor->AddItem(3,L"Tahoma",vtMissing); var_Editor->SortItems(VARIANT_TRUE,vtMissing); var_Editor->PutDropDownRows(4); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("Tahoma"); spGrid1->EndUpdate(); |
869 |
How do you embed HTML options into the anchor click string
// AnchorClick event - Occurs when an anchor element is clicked. void OnAnchorClickGrid1(LPCTSTR AnchorID,LPCTSTR Options) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); OutputDebugStringW( L"AnchorID" ); OutputDebugStringW( L"Options" ); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Car")))->PutDef(EXGRIDLib::exCellValueFormat,long(1)); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("<a mazda_1;options for 1>Mazda <b>1</b></a>"); var_Items->AddItem("<a mazda_2;options for 2>Mazda <b>2</b></a>"); var_Items->AddItem("<a mazda_3;options for 3a>Mazda <b>3.a</b></a>"); var_Items->AddItem("<a mazda_3;options for 3b>Mazda <b>3.b</b></a>"); spGrid1->EndUpdate(); |
868 |
How do I add a checkbox column (method 2)
// CellStateChanged event - Fired after cell's state has been changed. void OnCellStateChangedGrid1(long Item,long ColIndex) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); OutputDebugStringW( L"CheckBox Changed:" ); OutputDebugStringW( _bstr_t(spGrid1->GetItems()->GetCellState(Item,ColIndex)) ); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Check")))->PutDef(EXGRIDLib::exCellHasCheckBox,VARIANT_TRUE); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutCellState(var_Items->AddItem("Check 1"),long(0),0); var_Items->PutCellState(var_Items->AddItem("Check 2"),long(0),1); var_Items->PutCellState(var_Items->AddItem("Check 3"),long(0),0); var_Items->PutCellState(var_Items->AddItem("Check 4"),long(0),1); spGrid1->EndUpdate(); |
867 |
How do I add a checkbox column (method 1)
// Change event - Occurs when the user changes the cell's content. void OnChangeGrid1(long Item,long ColIndex,VARIANT FAR* NewValue) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); OutputDebugStringW( L"CheckBox Changed:" ); OutputDebugStringW( L"NewValue" ); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Check"))); EXGRIDLib::IEditorPtr var_Editor = var_Column->GetEditor(); var_Editor->PutEditType(EXGRIDLib::CheckValueType); var_Editor->PutOption(EXGRIDLib::exCheckValue2,long(1)); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem(long(0)); var_Items->AddItem(long(1)); var_Items->AddItem(long(0)); var_Items->AddItem(long(1)); spGrid1->EndUpdate(); |
866 |
How do I change the progress bar's appearance
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IAppearancePtr var_Appearance = spGrid1->GetVisualAppearance(); var_Appearance->Add(1,"c:\\exontrol\\images\\normal.ebn"); var_Appearance->Add(2,"c:\\exontrol\\images\\pushed.ebn"); EXGRIDLib::IEditorPtr var_Editor = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Progress")))->GetEditor(); var_Editor->PutEditType(EXGRIDLib::ProgressBarType); var_Editor->PutOption(EXGRIDLib::exProgressBarBackColor,long(16777216)); var_Editor->PutOption(EXGRIDLib::exProgressBarMarkTicker,long(33554432)); spGrid1->GetItems()->AddItem(long(33)); |
865 |
I have the rows with different background color, and when I select the item it takes the color of the SelBackColor, and therefore is no longer visible behind the color. Is there any option to make the item's color being visible (method 3)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->GetVisualAppearance()->Add(1,_bstr_t("gBFLBCJwBAEHhEJAEGg4BVEIQAAYAQGKIYBkAKBQAGaAoDDMOQwQwAAxjGKEEwsACEIrjKCRShyCYZRhGcTSBCIZBqEqSZLiEZRQCWIAzATGYBRfIUEgjBM6ExwG78e") + "gBHp/ZpkACIJJAaRjHQdJxGKKMQB9DIhCZpeKhWgkKIJBzOEyBRC4ERBGqNGrsIgLEqWZpnWhaNpWXYTLyBN64LhuK46g53O6wLxvK6hEr2dJ/YBcIAOfghf4NQ7EMRx" + "LC8Mw3BDvYDkOAABAIgI="); spGrid1->PutSelBackColor(0x1fffffe); spGrid1->PutShowFocusRect(VARIANT_FALSE); spGrid1->GetColumns()->Add(L"Items"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutItemBackColor(var_Items->AddItem("red"),RGB(255,0,0)); var_Items->PutItemBackColor(var_Items->AddItem("blue"),RGB(0,0,255)); var_Items->PutItemBackColor(var_Items->AddItem("green"),RGB(0,255,0)); spGrid1->EndUpdate(); |
864 |
I have the rows with different background color, and when I select the item it takes the color of the SelBackColor, and therefore is no longer visible behind the color. Is there any option to make the item's color being visible (method 2)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutSelBackMode(EXGRIDLib::exTransparent); spGrid1->PutShowFocusRect(VARIANT_FALSE); spGrid1->GetColumns()->Add(L"Items"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutItemBackColor(var_Items->AddItem("red"),RGB(255,0,0)); var_Items->PutItemBackColor(var_Items->AddItem("blue"),RGB(0,0,255)); var_Items->PutItemBackColor(var_Items->AddItem("green"),RGB(0,255,0)); spGrid1->EndUpdate(); |
863 |
I have the rows with different background color, and when I select the item it takes the color of the SelBackColor, and therefore is no longer visible behind the color. Is there any option to make the item's color being visible (method 1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutSelBackColor(spGrid1->GetBackColor()); spGrid1->PutSelForeColor(spGrid1->GetForeColor()); spGrid1->PutShowFocusRect(VARIANT_TRUE); spGrid1->GetColumns()->Add(L"Items"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutItemBackColor(var_Items->AddItem("red"),RGB(255,0,0)); var_Items->PutItemBackColor(var_Items->AddItem("blue"),RGB(0,0,255)); var_Items->PutItemBackColor(var_Items->AddItem("green"),RGB(0,255,0)); spGrid1->EndUpdate(); |
862 |
The BeforeExpandItem event is fired when clicking the drop down filter button. What we can do to prevent that
// BeforeExpandItem event - Fired before an item is about to be expanded (collapsed). void OnBeforeExpandItemGrid1(long Item,VARIANT FAR* Cancel) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); OutputDebugStringW( L"BeforeExpandItem" ); OutputDebugStringW( L"Item" ); spGrid1->GetItems()->InsertItem(Item,vtMissing,"new child"); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutLinesAtRoot(EXGRIDLib::exLinesAtRoot); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Items"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutFilterList(EXGRIDLib::exRootItems); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutItemHasChildren(var_Items->InsertItem(vtMissing,vtMissing,"Group 1"),VARIANT_TRUE); var_Items->PutItemHasChildren(var_Items->InsertItem(vtMissing,vtMissing,"Group 2"),VARIANT_TRUE); spGrid1->EndUpdate(); |
861 |
How can I change the shape of the line to be shown when user drag and drop data over the control, EBN
// OLEStartDrag event - Occurs when the OLEDrag method is called. void OnOLEStartDragGrid1(LPDISPATCH Data,long FAR* AllowedEffects) { // Data.SetData("data to be dragged") } /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutOLEDropMode(EXGRIDLib::exOLEDropManual); spGrid1->GetVisualAppearance()->Add(1,"C:\\Program Files\\Exontrol\\ExList\\Sample\\VB\\DragDrop\\insert_bottom.ebn"); spGrid1->PutBackground(EXGRIDLib::exListOLEDropPosition,0x1000000); spGrid1->GetColumns()->Add(L"Default"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("Item 1"); var_Items->AddItem("Item 2"); |
860 |
How can I highlight the item from cursor when the user drag and drop data over the control
// OLEStartDrag event - Occurs when the OLEDrag method is called. void OnOLEStartDragGrid1(LPDISPATCH Data,long FAR* AllowedEffects) { // Data.SetData("data to be dragged") } /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutOLEDropMode(EXGRIDLib::exOLEDropManual); spGrid1->PutBackground(EXGRIDLib::exListOLEDropPosition,RGB(1,0,0)); spGrid1->GetColumns()->Add(L"Default"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("Item 1"); var_Items->AddItem("Item 2"); |
859 |
Is it possible to always show the editor for all cells at all times
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemGrid1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->GetItems()->PutCellEditorVisible(Item,long(0),EXGRIDLib::exEditorVisible); spGrid1->GetItems()->PutCellEditorVisible(Item,long(1),EXGRIDLib::exEditorVisible); } // EditOpen event - Occurs when the edit operation starts. void OnEditOpenGrid1() { EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); _variant_t v = var_Items->GetCellValue(var_Items->GetFocusItem(),long(0)); _bstr_t c = var_Items->GetCellCaption(var_Items->GetFocusItem(),long(0)); EXGRIDLib::IEditorPtr var_Editor = spGrid1->GetColumns()->GetItem(long(1))->GetEditor(); var_Editor->ClearItems(); var_Editor->AddItem(v,L"c",vtMissing); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"DropDownList"))); EXGRIDLib::IEditorPtr var_Editor = var_Column->GetEditor(); var_Editor->PutEditType(EXGRIDLib::DropDownListType); var_Editor->AddItem(1,L"First",vtMissing); var_Editor->AddItem(2,L"Second",vtMissing); var_Editor->AddItem(3,L"Third",vtMissing); spGrid1->PutDrawGridLines(EXGRIDLib::exAllLines); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"DropDownList-Related")))->GetEditor()->PutEditType(EXGRIDLib::DropDownListType); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutCellValue(var_Items->AddItem(long(1)),long(1),long(-1)); var_Items->PutCellValue(var_Items->AddItem(long(2)),long(1),long(-1)); var_Items->PutCellValue(var_Items->AddItem(long(3)),long(1),long(-1)); var_Items->PutLockedItemCount(EXGRIDLib::exBottom,1); long h = var_Items->GetLockedItem(EXGRIDLib::exBottom,0); var_Items->PutItemDivider(h,0); var_Items->PutItemDividerLineAlignment(h,EXGRIDLib::DividerTop); var_Items->PutCellEditorVisible(h,long(0),EXGRIDLib::exEditorHidden); var_Items->PutCellSingleLine(h,long(0),EXGRIDLib::exCaptionWordWrap); var_Items->PutCellValueFormat(h,long(0),EXGRIDLib::exHTML); var_Items->PutCellValue(h,long(0),_bstr_t("The drop down editor in the second column is filled during the <b>EditOpen event</b>, and the values are based on the selection") + " on the first column."); spGrid1->EndUpdate(); |
858 |
How do I set a computated cell individually
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->GetColumns()->Add(L"Number"); spGrid1->GetColumns()->Add(L"Format"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem("1.23"); var_Items->PutCellValueFormat(h,long(1),EXGRIDLib::ValueFormatEnum(EXGRIDLib::exComputedField | EXGRIDLib::exHTML)); var_Items->PutCellValue(h,long(1),"2 * %0 + ` <font ;6><fgcolor=808080>(2 * Number)`"); h = var_Items->AddItem("1.23"); var_Items->PutCellValueFormat(h,long(1),EXGRIDLib::ValueFormatEnum(EXGRIDLib::exComputedField | EXGRIDLib::exHTML)); var_Items->PutCellValue(h,long(1),"3 * %0 + ` <font ;6><fgcolor=808080>(3 * Number)`"); h = var_Items->AddItem("1.23"); var_Items->PutCellValueFormat(h,long(1),EXGRIDLib::ValueFormatEnum(EXGRIDLib::exComputedField | EXGRIDLib::exHTML)); var_Items->PutCellValue(h,long(1),"currency(%0) + ` <font ;6><fgcolor=808080>( Currency(Number) )`"); spGrid1->EndUpdate(); |
857 |
Is it possible to assign a different editor for some cells
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IEditorPtr var_Editor = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Column - DropDownList")))->GetEditor(); var_Editor->PutEditType(EXGRIDLib::DropDownListType); var_Editor->AddItem(1,L"First item",vtMissing); var_Editor->AddItem(2,L"Second item",vtMissing); var_Editor->AddItem(3,L"Third item",vtMissing); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Cell - DropDownList")))->PutDef(EXGRIDLib::exCellValueFormat,long(1)); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem(long(1)); EXGRIDLib::IEditorPtr var_Editor1 = var_Items->GetCellEditor(h,long(1)); var_Editor1->PutEditType(EXGRIDLib::DropDownListType); var_Editor1->AddItem(1,L"<b>First</b> item",vtMissing); var_Editor1->AddItem(2,L"<b>Second</b> item",vtMissing); var_Editor1->AddItem(3,L"<b>Third</b> item",vtMissing); var_Editor1->AddItem(4,L"<b>Forth</b> item",vtMissing); var_Items->PutCellValue(h,long(1),long(2)); h = var_Items->AddItem(long(2)); EXGRIDLib::IEditorPtr var_Editor2 = var_Items->GetCellEditor(h,long(1)); var_Editor2->PutEditType(EXGRIDLib::DropDownListType); var_Editor2->AddItem(1,L"<b>Aka First</b> item",vtMissing); var_Editor2->AddItem(2,L"<b>Aka Second</b> item",vtMissing); var_Editor2->AddItem(3,L"<b>Aka Third</b> item",vtMissing); var_Editor2->AddItem(4,L"<b>Aka Forth</b> item",vtMissing); var_Items->PutCellValue(h,long(1),long(2)); |
856 |
Is it possible to define the keys of the drop down values to be strings rather than numeric values
// Change event - Occurs when the user changes the cell's content. void OnChangeGrid1(long Item,long ColIndex,VARIANT FAR* NewValue) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); OutputDebugStringW( L"NewValue is" ); OutputDebugStringW( L"NewValue" ); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IEditorPtr var_Editor = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"DropDownList-String")))->GetEditor(); var_Editor->PutEditType(EXGRIDLib::DropDownListType); var_Editor->AddItem(1,L"NYC|New York City",vtMissing); var_Editor->AddItem(2,L"CJN|Cluj Napoca",vtMissing); EXGRIDLib::IEditorPtr var_Editor1 = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"DropDownList-Numeric")))->GetEditor(); var_Editor1->PutEditType(EXGRIDLib::DropDownListType); var_Editor1->AddItem(1,L"New York City",vtMissing); var_Editor1->AddItem(2,L"Cluj Napoca",vtMissing); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutCellValue(var_Items->AddItem("NYC"),long(1),long(2)); |
855 |
The Change event gets me the today date. How can I find what user typed
// Change event - Occurs when the user changes the cell's content. void OnChangeGrid1(long Item,long ColIndex,VARIANT FAR* NewValue) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); OutputDebugStringW( L"NewValue:" ); OutputDebugStringW( L"NewValue" ); OutputDebugStringW( L"EditingValue:" ); OutputDebugStringW( spGrid1->GetEditingText() ); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Edit")))->GetEditor()->PutEditType(EXGRIDLib::DateType); spGrid1->GetItems()->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()); spGrid1->EndUpdate(); |
854 |
I have an edit field, when going to edit mode, the rightmost part is shown. Is it possible to show the left part instead
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Edit"))); var_Column->PutWidth(64); var_Column->PutAllowSizing(VARIANT_FALSE); EXGRIDLib::IEditorPtr var_Editor = var_Column->GetEditor(); var_Editor->PutEditType(EXGRIDLib::MaskType); var_Editor->PutMask(L";;;rich"); spGrid1->GetColumns()->Add(L"Empty"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("This is a bit ot long text"); var_Items->AddItem(""); spGrid1->EndUpdate(); |
853 |
I have a drop down field, the control shows the rightmost part of the selected caption. Is it possible to show the left part
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"DropDown"))); var_Column->PutWidth(64); var_Column->PutAllowSizing(VARIANT_FALSE); EXGRIDLib::IEditorPtr var_Editor = var_Column->GetEditor(); var_Editor->PutDropDownAlignment(EXGRIDLib::AlignmentEnum(0x20)); var_Editor->PutEditType(EXGRIDLib::DropDownType); var_Editor->AddItem(1,L"First item. This is a bit ot long text",vtMissing); var_Editor->AddItem(2,L"Second item. This is a bit ot long text",vtMissing); var_Editor->AddItem(3,L"Third item. This is a bit ot long text",vtMissing); var_Editor->PutMask(L";;;rich"); EXGRIDLib::IColumnPtr var_Column1 = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"PickEdit"))); var_Column1->PutWidth(64); var_Column1->PutAllowSizing(VARIANT_FALSE); EXGRIDLib::IEditorPtr var_Editor1 = var_Column1->GetEditor(); var_Editor1->PutDropDownAlignment(EXGRIDLib::AlignmentEnum(0x20)); var_Editor1->PutEditType(EXGRIDLib::PickEditType); var_Editor1->AddItem(1,L"First item. This is a bit ot long text",vtMissing); var_Editor1->AddItem(2,L"Second item. This is a bit ot long text",vtMissing); var_Editor1->AddItem(3,L"Third item. This is a bit ot long text",vtMissing); var_Editor1->PutMask(L";;;rich"); spGrid1->GetColumns()->Add(L"Empty"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutCellValue(var_Items->AddItem("First item. This is a bit ot long text"),long(1),"Second item. This is a bit ot long text"); long h = var_Items->AddItem("First item. This is a bit ot long text"); EXGRIDLib::IEditorPtr var_Editor2 = var_Items->GetCellEditor(h,long(0)); var_Editor2->PutDropDownAlignment(EXGRIDLib::AlignmentEnum(0x20)); var_Editor2->PutEditType(EXGRIDLib::DropDownType); var_Editor2->AddItem(1,L"First item. This is a bit ot long text",vtMissing); var_Editor2->AddItem(2,L"Second item. This is a bit ot long text",vtMissing); var_Editor2->AddItem(3,L"Third item. This is a bit ot long text",vtMissing); var_Items->PutCellValue(h,long(1),"Second item. This is a bit ot long text"); EXGRIDLib::IEditorPtr var_Editor3 = var_Items->GetCellEditor(h,long(1)); var_Editor3->PutDropDownAlignment(EXGRIDLib::AlignmentEnum(0x20)); var_Editor3->PutEditType(EXGRIDLib::PickEditType); var_Editor3->AddItem(1,L"First item. This is a bit ot long text",vtMissing); var_Editor3->AddItem(2,L"Second item. This is a bit ot long text",vtMissing); var_Editor3->AddItem(3,L"Third item. This is a bit ot long text",vtMissing); spGrid1->EndUpdate(); |
852 |
Is there a property for the back color of the dropdown field
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); EXGRIDLib::IEditorPtr var_Editor = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Date")))->GetEditor(); var_Editor->PutEditType(EXGRIDLib::DateType); var_Editor->PutOption(EXGRIDLib::exDropDownBackColor,long(15790320)); var_Editor->PutOption(EXGRIDLib::exDropDownForeColor,long(65793)); spGrid1->GetItems()->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()); spGrid1->EndUpdate(); |
851 |
Is it possible to change a back color of the field/cell when it takes a focus
// EditClose event - Occurs when the edit operation ends. void OnEditCloseGrid1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->ClearCellBackColor(var_Items->GetFocusItem(),spGrid1->GetFocusColumnIndex()); } // EditOpen event - Occurs when the edit operation starts. void OnEditOpenGrid1() { EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutCellBackColor(var_Items->GetFocusItem(),spGrid1->GetFocusColumnIndex(),RGB(255,0,0)); EXGRIDLib::IItemsPtr var_Items1 = spGrid1->GetItems(); var_Items1->PutCellValue(var_Items1->GetFocusItem(),spGrid1->GetFocusColumnIndex(),spGrid1->GetItems()->GetCellValue(spGrid1->GetItems()->GetFocusItem(),spGrid1->GetFocusColumnIndex())); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutFullRowSelect(EXGRIDLib::exColumnSel); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"C1")))->GetEditor()->PutEditType(EXGRIDLib::EditType); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"C2")))->GetEditor()->PutEditType(EXGRIDLib::EditType); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutCellValue(var_Items->AddItem("v1"),long(1),"v2"); var_Items->PutCellValue(var_Items->AddItem("v3"),long(1),"v4"); |
850 |
How can I display the current date mask, but still allow empty values
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutCauseValidateValue(EXGRIDLib::exValidateCell); spGrid1->PutFullRowSelect(EXGRIDLib::exColumnSel); spGrid1->PutDrawGridLines(EXGRIDLib::exRowLines); EXGRIDLib::IEditorPtr var_Editor = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Date")))->GetEditor(); var_Editor->PutEditType(EXGRIDLib::DateType); var_Editor->PutMask(_bstr_t("!99/99/9999;1;;empty=1,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character") + "!,select=4,overtype"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem(vtMissing); var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Items->AddItem(vtMissing); spGrid1->EndUpdate(); |
849 |
How can I align the days in a DateType editor
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->GetColumns()->Add(L"DropDown"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); EXGRIDLib::IEditorPtr var_Editor = var_Items->GetCellEditor(var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()),long(0)); var_Editor->PutEditType(EXGRIDLib::DateType); var_Editor->PutDropDownAlignment(EXGRIDLib::RightAlignment); EXGRIDLib::IEditorPtr var_Editor1 = var_Items->GetCellEditor(var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()),long(0)); var_Editor1->PutEditType(EXGRIDLib::DateType); var_Editor1->PutDropDownAlignment(EXGRIDLib::CenterAlignment); EXGRIDLib::IEditorPtr var_Editor2 = var_Items->GetCellEditor(var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()),long(0)); var_Editor2->PutEditType(EXGRIDLib::DateType); var_Editor2->PutDropDownAlignment(EXGRIDLib::LeftAlignment); EXGRIDLib::IEditorPtr var_Editor3 = var_Items->GetCellEditor(var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()),long(0)); var_Editor3->PutEditType(EXGRIDLib::DateType); var_Editor3->PutDropDownAlignment(EXGRIDLib::AlignmentEnum(0x20)); EXGRIDLib::IEditorPtr var_Editor4 = var_Items->GetCellEditor(var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()),long(0)); var_Editor4->PutEditType(EXGRIDLib::DateType); var_Editor4->PutDropDownAlignment(EXGRIDLib::AlignmentEnum(0x20 | EXGRIDLib::CenterAlignment)); EXGRIDLib::IEditorPtr var_Editor5 = var_Items->GetCellEditor(var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()),long(0)); var_Editor5->PutEditType(EXGRIDLib::DateType); var_Editor5->PutDropDownAlignment(EXGRIDLib::AlignmentEnum(0x20 | EXGRIDLib::RightAlignment)); |
848 |
How can I align the drop down portion rather the inside captions
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"DropDown")))->GetEditor()->PutEditType(EXGRIDLib::DateType); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); EXGRIDLib::IEditorPtr var_Editor = var_Items->GetCellEditor(var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()),long(0)); var_Editor->PutEditType(EXGRIDLib::DateType); var_Editor->PutDropDownAlignment(EXGRIDLib::AlignmentEnum(0x20)); EXGRIDLib::IEditorPtr var_Editor1 = var_Items->GetCellEditor(var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()),long(0)); var_Editor1->PutEditType(EXGRIDLib::DateType); var_Editor1->PutDropDownAlignment(EXGRIDLib::AlignmentEnum(0x10)); var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()); |
847 |
Is it possible to show a message that the field is empty
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutDrawGridLines(EXGRIDLib::exRowLines); spGrid1->PutFullRowSelect(EXGRIDLib::exColumnSel); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Float"))); EXGRIDLib::IEditorPtr var_Editor = var_Column->GetEditor(); var_Editor->PutEditType(EXGRIDLib::MaskType); var_Editor->PutMask(L";;;float,digits=0,grouping=,invalid=empty,warning=invalid character"); spGrid1->GetItems()->AddItem(long(192278)); spGrid1->GetItems()->AddItem(long(1000)); |
846 |
How can I mask a date
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutCauseValidateValue(EXGRIDLib::exValidateCell); spGrid1->PutFullRowSelect(EXGRIDLib::exColumnSel); spGrid1->PutDrawGridLines(EXGRIDLib::exRowLines); spGrid1->GetColumns()->Add(L"Date"); spGrid1->GetColumns()->Add(L"Mask"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXGRIDLib::IEditorPtr var_Editor = var_Items->GetCellEditor(h,long(0)); var_Editor->PutEditType(EXGRIDLib::DateType); var_Editor->PutMask(_bstr_t("{1,12}/{1,31}/{1950,2050};1;;select=1,warning=Invalid character!,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</") + "b>!,validateas=1"); var_Items->PutCellValue(h,long(1),var_Items->GetCellEditor(h,long(0))->GetMask()); h = var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXGRIDLib::IEditorPtr var_Editor1 = var_Items->GetCellEditor(h,long(0)); var_Editor1->PutEditType(EXGRIDLib::DateType); var_Editor1->PutMask(_bstr_t("!99/99/9999;1;;empty,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,") + "select=4,overtype"); var_Items->PutCellValue(h,long(1),var_Items->GetCellEditor(h,long(0))->GetMask()); h = var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXGRIDLib::IEditorPtr var_Editor2 = var_Items->GetCellEditor(h,long(0)); var_Editor2->PutEditType(EXGRIDLib::DateType); var_Editor2->PutMask(_bstr_t("!99/99/9999;;;empty,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,s") + "elect=4,overtype"); var_Items->PutCellValue(h,long(1),var_Items->GetCellEditor(h,long(0))->GetMask()); h = var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXGRIDLib::IEditorPtr var_Editor3 = var_Items->GetCellEditor(h,long(0)); var_Editor3->PutEditType(EXGRIDLib::DateType); var_Editor3->PutMask(_bstr_t("!99/99/9999;; ;select=4,overtype,empty,warning=Invalid character!,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'<") + "/b>!,validateas=1"); var_Items->PutCellValue(h,long(1),var_Items->GetCellEditor(h,long(0))->GetMask()); h = var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXGRIDLib::IEditorPtr var_Editor4 = var_Items->GetCellEditor(h,long(0)); var_Editor4->PutEditType(EXGRIDLib::DateType); var_Editor4->PutMask(_bstr_t("![0-9 ][0-9 ]/[0-9 ][0-9 ]/[0-9 ][0-9 ][0-9 ][0-9 ];1;;empty,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%") + "mask%>'</b>!,warning=Invalid character!,select=4,leading= "); var_Items->PutCellValue(h,long(1),var_Items->GetCellEditor(h,long(0))->GetMask()); h = var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Items->PutFormatCell(h,long(0),L"len(value) ? shortdateF(value) : ``"); EXGRIDLib::IEditorPtr var_Editor5 = var_Items->GetCellEditor(h,long(0)); var_Editor5->PutEditType(EXGRIDLib::DateType); var_Editor5->PutMask(_bstr_t("!99/99/9999;1;;empty,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,") + "select=4,overtype,leading"); var_Items->PutCellValue(h,long(1),var_Items->GetCellEditor(h,long(0))->GetMask()); h = var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Items->PutFormatCell(h,long(0),L"len(value) ? shortdateF(value) : ``"); EXGRIDLib::IEditorPtr var_Editor6 = var_Items->GetCellEditor(h,long(0)); var_Editor6->PutEditType(EXGRIDLib::DateType); var_Editor6->PutMask(_bstr_t("!00/00/0000;1;;empty,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,") + "select=4,overtype,leading"); var_Items->PutCellValue(h,long(1),var_Items->GetCellEditor(h,long(0))->GetMask()); h = var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Items->PutFormatCell(h,long(0),L"len(value) ? shortdateF(value) : ``"); EXGRIDLib::IEditorPtr var_Editor7 = var_Items->GetCellEditor(h,long(0)); var_Editor7->PutEditType(EXGRIDLib::DateType); var_Editor7->PutMask(_bstr_t("!00/00/0000;;0;empty,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,") + "select=4,overtype"); var_Items->PutCellValue(h,long(1),var_Items->GetCellEditor(h,long(0))->GetMask()); h = var_Items->AddItem(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Items->PutFormatCell(h,long(0),L"len(value) ? shortdateF(value) : ``"); EXGRIDLib::IEditorPtr var_Editor8 = var_Items->GetCellEditor(h,long(0)); var_Editor8->PutEditType(EXGRIDLib::DateType); var_Editor8->PutMask(_bstr_t("!00/00/0000;;;empty,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,s") + "elect=1,overtype"); var_Items->PutCellValue(h,long(1),var_Items->GetCellEditor(h,long(0))->GetMask()); spGrid1->EndUpdate(); |
845 |
How can I display and edit an integer number to show grouping digits too ( no decimals)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Float"))); var_Column->PutFormatColumn(L"value format `0`"); EXGRIDLib::IEditorPtr var_Editor = var_Column->GetEditor(); var_Editor->PutEditType(EXGRIDLib::MaskType); var_Editor->PutMask(L";;;float,digits=0"); spGrid1->GetItems()->AddItem(long(192278)); |
844 |
How can I display and edit a float number to show grouping digits too
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Float"))); var_Column->PutFormatColumn(L"value format ``"); EXGRIDLib::IEditorPtr var_Editor = var_Column->GetEditor(); var_Editor->PutEditType(EXGRIDLib::MaskType); var_Editor->PutMask(L";;;float"); spGrid1->GetItems()->AddItem(long(192278)); |
843 |
How can I mask a phone number
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutCauseValidateValue(EXGRIDLib::exValidateCell); spGrid1->PutDrawGridLines(EXGRIDLib::exRowLines); spGrid1->PutFullRowSelect(EXGRIDLib::exColumnSel); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Phone")))->GetEditor()->PutEditType(EXGRIDLib::MaskType); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem(vtMissing); EXGRIDLib::IEditorPtr var_Editor = var_Items->GetCellEditor(h,long(0)); var_Editor->PutEditType(EXGRIDLib::MaskType); var_Editor->PutMask(_bstr_t("!(999) 000 0000;1;;select=1,empty,overtype,warning=invalid characer,invalid=The value you entered isn't appropriate for the inp") + "ut mask <b>'<%mask%>'</b> specified for this field."); h = var_Items->AddItem("0123"); EXGRIDLib::IEditorPtr var_Editor1 = var_Items->GetCellEditor(h,long(0)); var_Editor1->PutEditType(EXGRIDLib::MaskType); var_Editor1->PutMask(L"!(999) 000 0000;2;;select=4"); h = var_Items->AddItem("0123"); EXGRIDLib::IEditorPtr var_Editor2 = var_Items->GetCellEditor(h,long(0)); var_Editor2->PutEditType(EXGRIDLib::MaskType); var_Editor2->PutMask(L"`Phone: `!(999) 000-0000"); h = var_Items->AddItem("(074) 876-1222"); EXGRIDLib::IEditorPtr var_Editor3 = var_Items->GetCellEditor(h,long(0)); var_Editor3->PutEditType(EXGRIDLib::MaskType); var_Editor3->PutMask(L"!(999) 000-0000;0"); |
842 |
Is it possible to display the ColorType fields using RGB format
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Color")))->GetEditor()->PutEditType(EXGRIDLib::ColorType); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem(long(255)); long h = var_Items->AddItem(long(255)); EXGRIDLib::IEditorPtr var_Editor = var_Items->GetCellEditor(h,long(0)); var_Editor->PutEditType(EXGRIDLib::ColorType); var_Editor->PutMask(L"`RGB(`{0,255}\\,{0,255}\\,{0,255}`)`;;0"); h = var_Items->AddItem(long(255)); EXGRIDLib::IEditorPtr var_Editor1 = var_Items->GetCellEditor(h,long(0)); var_Editor1->PutEditType(EXGRIDLib::ColorType); var_Editor1->PutMask(L"`&H`XXXXXXXX`&`;;0;overtype,insertype,warning=Wrong!"); h = var_Items->AddItem(long(255)); EXGRIDLib::IEditorPtr var_Editor2 = var_Items->GetCellEditor(h,long(0)); var_Editor2->PutEditType(EXGRIDLib::ColorType); var_Editor2->PutMask(L"`0x`XX `0x`XX `0x`XX;;0;overtype,insertype,warning=Wrong!"); h = var_Items->AddItem(long(255)); EXGRIDLib::IEditorPtr var_Editor3 = var_Items->GetCellEditor(h,long(0)); var_Editor3->PutEditType(EXGRIDLib::ColorType); var_Editor3->PutMask(L"R{0,255} G{0,255} B{0,255};;0;overtype,insertype,warning=Wrong!"); h = var_Items->AddItem(long(255)); EXGRIDLib::IEditorPtr var_Editor4 = var_Items->GetCellEditor(h,long(0)); var_Editor4->PutEditType(EXGRIDLib::ColorType); var_Editor4->PutMask(L"`(hexa) RGB 0x`XXXXXX;;0;overtype,insertype,warning=Wrong!"); h = var_Items->AddItem(long(255)); EXGRIDLib::IEditorPtr var_Editor5 = var_Items->GetCellEditor(h,long(0)); var_Editor5->PutEditType(EXGRIDLib::ColorType); var_Editor5->PutMask(L"`(decimal) Red: `{0,255}` Green: `{0,255}` Blue: `{0,255};;0;overtype,insertype,warning=Wrong!"); h = var_Items->AddItem(long(255)); EXGRIDLib::IEditorPtr var_Editor6 = var_Items->GetCellEditor(h,long(0)); var_Editor6->PutEditType(EXGRIDLib::ColorType); var_Editor6->PutMask(L"`(combine) Red: `{0,255}` Green: 0x`XX` Blue: `{0,255};;0;overtype,insertype,warning=Wrong!"); |
841 |
How can I add the ExComboBox as an user editor
// UserEditorClose event - Fired the user editor is about to be opened. void OnUserEditorCloseGrid1(LPDISPATCH Object,long Item,long ColIndex) { // Items.CellValue(Item,ColIndex) = Object.Value } // UserEditorOleEvent event - Occurs when an user editor fires an event. void OnUserEditorOleEventGrid1(LPDISPATCH Object,LPDISPATCH Ev,BOOL FAR* CloseEditor,long Item,long ColIndex) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); OutputDebugStringW( L"Ev" ); } // UserEditorOpen event - Occurs when an user editor is about to be opened. void OnUserEditorOpenGrid1(LPDISPATCH Object,long Item,long ColIndex) { // Object.Value = Me.Items.CellValue(Item,ColIndex) } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); EXGRIDLib::IEditorPtr var_Editor = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Exontrol.ComboBox")))->GetEditor(); var_Editor->PutEditType(EXGRIDLib::UserEditorType); var_Editor->UserEditor(L"Exontrol.ComboBox",L""); ObjectPtr var_Object = var_Editor->GetUserEditorObject(); spGrid1->PutDrawGridLines(EXGRIDLib::exRowLines); spGrid1->PutDefaultItemHeight(21); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutCellEditorVisible(var_Items->AddItem(long(10248)),long(0),EXGRIDLib::exEditorVisible); var_Items->PutCellEditorVisible(var_Items->AddItem(long(10249)),long(0),EXGRIDLib::exEditorVisible); var_Items->PutCellEditorVisible(var_Items->AddItem(long(10250)),long(0),EXGRIDLib::exEditorVisible); spGrid1->EndUpdate(); |
840 |
How can I add a header row
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutShowLockedItems(VARIANT_TRUE); spGrid1->PutDrawGridLines(EXGRIDLib::exVLines); spGrid1->GetColumns()->Add(L"C1"); spGrid1->GetColumns()->Add(L"C2"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutLockedItemCount(EXGRIDLib::exTop,1); long h = var_Items->GetLockedItem(EXGRIDLib::exTop,0); var_Items->PutItemBackColor(h,RGB(128,128,128)); var_Items->PutItemForeColor(h,RGB(255,255,255)); var_Items->PutCellValue(h,long(0),"footer c1"); var_Items->PutCellValue(h,long(1),"footer c2"); var_Items->PutCellValue(var_Items->AddItem("cell"),long(1),"cell"); |
839 |
How can I add a footer row
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutShowLockedItems(VARIANT_TRUE); spGrid1->PutDrawGridLines(EXGRIDLib::exVLines); spGrid1->GetColumns()->Add(L"C1"); spGrid1->GetColumns()->Add(L"C2"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutLockedItemCount(EXGRIDLib::exBottom,1); long h = var_Items->GetLockedItem(EXGRIDLib::exBottom,0); var_Items->PutItemBackColor(h,RGB(128,128,128)); var_Items->PutItemForeColor(h,RGB(255,255,255)); var_Items->PutCellValue(h,long(0),"footer c1"); var_Items->PutCellValue(h,long(1),"footer c2"); var_Items->PutCellValue(var_Items->AddItem("cell"),long(1),"cell"); |
838 |
How can I programmatically add more columns to the sort bar and other to be sorted, but not included in the sort bar
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutSortBarVisible(VARIANT_TRUE); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); var_Columns->Add(L"0"); var_Columns->Add(L"1"); var_Columns->Add(L"2"); var_Columns->Add(L"3"); var_Columns->Add(L"4"); spGrid1->PutLayout(L"multiplesort=\"C3:1 C4:2\";singlesort=\"C2:1\""); |
837 |
How can I fix a column, while other sizable and fill the control's client
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutColumnAutoResize(VARIANT_TRUE); spGrid1->GetColumns()->Add(L"Sizable"); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"F"))); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutWidth(16); |
836 |
Is it possible to use empty values on a PickEditType editor (method 2)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IEditorPtr var_Editor = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"DropDown")))->GetEditor(); var_Editor->PutEditType(EXGRIDLib::PickEditType); var_Editor->AddItem(0,L"",vtMissing); var_Editor->AddItem(1,L"The first item",vtMissing); var_Editor->AddItem(2,L"The second item",vtMissing); var_Editor->AddItem(3,L"The third item",vtMissing); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("The first item"); var_Items->AddItem(""); var_Items->AddItem("The third item"); |
835 |
Is it possible to use empty values on a PickEditType editor (method 1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IEditorPtr var_Editor = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"DropDown")))->GetEditor(); var_Editor->PutEditType(EXGRIDLib::PickEditType); var_Editor->PutOption(EXGRIDLib::exPickAllowEmpty,VARIANT_TRUE); var_Editor->AddItem(1,L"The first item",vtMissing); var_Editor->AddItem(2,L"The second item",vtMissing); var_Editor->AddItem(3,L"The third item",vtMissing); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("The first item"); var_Items->AddItem(""); var_Items->AddItem("The third item"); |
834 |
How can I specify an unselectable cell
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); var_Columns->Add(L"C1"); var_Columns->Add(L"C2"); var_Columns->Add(L"C3"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem("unselectable item"); var_Items->PutCellValue(h,long(1),"unselectable item"); var_Items->PutCellValue(h,long(2),"unselectable item"); var_Items->PutSelectableItem(h,VARIANT_FALSE); h = var_Items->AddItem("selectable cell"); var_Items->PutCellValue(h,long(1),"unselectable cell"); var_Items->PutCellEnabled(h,long(1),VARIANT_FALSE); var_Items->PutCellForeColor(h,long(1),RGB(0,0,0)); var_Items->PutCellValue(h,long(2),"disabled cell"); var_Items->PutCellEnabled(h,long(2),VARIANT_FALSE); h = var_Items->AddItem("disabled item"); var_Items->PutCellValue(h,long(1),"disabled item"); var_Items->PutCellValue(h,long(2),"disabled item"); var_Items->PutEnableItem(h,VARIANT_FALSE); var_Items->PutSelectableItem(h,VARIANT_FALSE); spGrid1->EndUpdate(); |
833 |
Is it possible to edit a float number without using of e/E/d/D (exponent) and +/- (signs) characters
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IEditorPtr var_Editor = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Edit")))->GetEditor(); var_Editor->PutEditType(EXGRIDLib::EditType); var_Editor->PutNumeric(EXGRIDLib::NumericEnum(EXGRIDLib::exDisableSigns | EXGRIDLib::exFloatInteger)); spGrid1->GetItems()->AddItem(double(1.22)); |
832 |
How can I edit a float number with no using of e/E/d/D and + character
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IEditorPtr var_Editor = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Edit")))->GetEditor(); var_Editor->PutEditType(EXGRIDLib::EditType); var_Editor->PutNumeric(EXGRIDLib::NumericEnum(EXGRIDLib::exDisablePlus | EXGRIDLib::exFloatInteger)); spGrid1->GetItems()->AddItem(double(1.22)); |
831 |
Is it possible to edit a float number with no using of e/E/d/D (exponent) characters
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IEditorPtr var_Editor = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Edit")))->GetEditor(); var_Editor->PutEditType(EXGRIDLib::EditType); var_Editor->PutNumeric(EXGRIDLib::exFloatInteger); spGrid1->GetItems()->AddItem(double(1.22)); |
830 |
How can I edit an integer with no using of +/- signs
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IEditorPtr var_Editor = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Edit")))->GetEditor(); var_Editor->PutEditType(EXGRIDLib::EditType); var_Editor->PutNumeric(EXGRIDLib::NumericEnum(0xfc | EXGRIDLib::exDisableSigns | EXGRIDLib::exFloatInteger | EXGRIDLib::exFloat)); spGrid1->GetItems()->AddItem(long(1)); |
829 |
When I'm trying to show string with "line break" character (vbCrLF) in a textbox, it shows 2 squares. Is there any way to hide these squares
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); var_Columns->Add(L"Value"); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"CellSingleLine = False"))); var_Column->PutComputedField(L"%0"); var_Column->PutDef(EXGRIDLib::exCellSingleLine,VARIANT_FALSE); EXGRIDLib::IColumnPtr var_Column1 = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"FormatColumn/replace CRLF"))); var_Column1->PutComputedField(L"%0"); var_Column1->PutFormatColumn(L"value replace `\\r\\n` with ``"); EXGRIDLib::IColumnPtr var_Column2 = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"FormatColumn/replace TAB,CRLF"))); var_Column2->PutComputedField(L"%0"); var_Column2->PutFormatColumn(L"(value replace `\\t` with ``) replace `\\r\\n` with ``"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("a\\ta\\r\\nb\\tb"); |
828 |
Is there any way to "unselect" radio group
// DblClick event - Occurs when the user dblclk the left mouse button over an object. void OnDblClickGrid1(short Shift,long X,long Y) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->GetCellChecked(1234); var_Items->PutCellHasCheckBox(long(0),h,VARIANT_TRUE); var_Items->PutCellState(long(0),h,0); var_Items->PutCellHasCheckBox(long(0),h,VARIANT_FALSE); } // SelectionChanged event - Fired after a new item has been selected. void OnSelectionChangedGrid1() { EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutCellState(var_Items->GetFocusItem(),long(0),1); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutMarkSearchColumn(VARIANT_FALSE); spGrid1->PutSelBackColor(RGB(255,255,128)); spGrid1->PutSelForeColor(RGB(0,0,0)); spGrid1->GetColumns()->Add(L"Default"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem("Radio 1"); var_Items->PutCellHasRadioButton(h,long(0),VARIANT_TRUE); var_Items->PutCellRadioGroup(h,long(0),1234); h = var_Items->AddItem("Radio 2"); var_Items->PutCellHasRadioButton(h,long(0),VARIANT_TRUE); var_Items->PutCellRadioGroup(h,long(0),1234); var_Items->PutCellState(h,long(0),1); h = var_Items->AddItem("Radio 3"); var_Items->PutCellHasRadioButton(h,long(0),VARIANT_TRUE); var_Items->PutCellRadioGroup(h,long(0),1234); |
827 |
The Column.Alignment property does not seem to work for cells with images in them. What can be done
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->Images(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") + "lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" + "0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" + "NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA="); spGrid1->PutTreeColumnIndex(-1); spGrid1->PutDrawGridLines(EXGRIDLib::exAllLines); spGrid1->PutHeaderHeight(24); spGrid1->PutDefaultItemHeight(24); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Image"))); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutWidth(32); var_Column->PutHTMLCaption(L"<img>1</img>"); var_Column->PutHeaderAlignment(EXGRIDLib::CenterAlignment); var_Column->PutAlignment(EXGRIDLib::CenterAlignment); var_Column->PutDef(EXGRIDLib::exCellValueFormat,long(1)); spGrid1->GetColumns()->Add(L"Rest"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("<img>1</img>"); var_Items->AddItem("<img>2</img>"); var_Items->AddItem("<img>3</img>"); spGrid1->EndUpdate(); |
826 |
Can I change the format of date to be shown in the control
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); var_Columns->Add(L"Default"); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Format.1"))); var_Column->PutComputedField(L"%0"); var_Column->PutFormatColumn(L"dateF(value) replace `/` with `-`"); EXGRIDLib::IColumnPtr var_Column1 = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Format.2"))); var_Column1->PutComputedField(L"%0"); var_Column1->PutDef(EXGRIDLib::exCellValueFormat,long(1)); var_Column1->PutFormatColumn(L"`<b>`+ shortdate(value) + `</b> ` + timeF(value)"); EXGRIDLib::IColumnPtr var_Column2 = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Format.3"))); var_Column2->PutComputedField(L"%0"); var_Column2->PutDef(EXGRIDLib::exCellValueFormat,long(1)); var_Column2->PutFormatColumn(_bstr_t("( dateF(value) replace `/` with `-` ) + ` <b>`+ ( weekday(value) case ( 0 : `Su`; 1 : `Mo`; 2 : `Tu`; 3 : `We`; 4 : `Th`; 5 : `") + "Fr`; 6 : `Sa`) )"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem(COleDateTime(2001,1,1,10,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2001,1,2,10,00,00).operator DATE()); |
825 |
How do I arrange my columns on multiple levels
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutColumnAutoResize(VARIANT_FALSE); spGrid1->PutDrawGridLines(EXGRIDLib::exAllLines); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"C0"))); var_Column->PutExpandColumns(L"1,2"); var_Column->PutDisplayExpandButton(VARIANT_FALSE); var_Columns->Add(L"C1"); var_Columns->Add(L"C2"); var_Columns->Add(L"C3"); EXGRIDLib::IColumnPtr var_Column1 = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"C4"))); var_Column1->PutExpandColumns(L"5,6"); var_Column1->PutDisplayExpandButton(VARIANT_FALSE); var_Columns->Add(L"C5"); EXGRIDLib::IColumnPtr var_Column2 = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"C6"))); var_Column2->PutExpandColumns(L"6,7"); var_Column2->PutDisplayExpandButton(VARIANT_FALSE); var_Columns->Add(L"C7"); spGrid1->EndUpdate(); |
824 |
Does your control support expandable header or columns, so I can arrange it on multiple levels
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutDrawGridLines(EXGRIDLib::exAllLines); spGrid1->PutBackColorLevelHeader(RGB(240,240,240)); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Photo"))); var_Column->PutAllowSizing(VARIANT_FALSE); var_Column->PutWidth(32); var_Columns->Add(L"Personal Info"); var_Columns->Add(L"Title"); var_Columns->Add(L"Name"); var_Columns->Add(L"First"); var_Columns->Add(L"Last"); var_Columns->Add(L"Address"); var_Columns->GetItem("Personal Info")->PutExpandColumns(L"2,3"); EXGRIDLib::IColumnPtr var_Column1 = var_Columns->GetItem("Name"); var_Column1->PutExpandColumns(L"4,5"); var_Column1->PutExpanded(VARIANT_FALSE); spGrid1->EndUpdate(); |
823 |
How can I use the MinWidthAutoResize/MaxWidthAutoResize
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExGrid\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spGrid1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); EXGRIDLib::IColumnPtr var_Column = spGrid1->GetColumns()->GetItem(long(0)); var_Column->PutMaxWidthAutoResize(32); var_Column->PutWidthAutoResize(VARIANT_TRUE); spGrid1->EndUpdate(); |
822 |
Does your control support subscript or superscript, in HTML captions
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutColumnAutoResize(VARIANT_FALSE); spGrid1->PutHeaderHeight(28); spGrid1->PutDefaultItemHeight(24); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Column 1"))); var_Column->PutHTMLCaption(L"Column <b><off 2><font ;6>1"); var_Column->PutDef(EXGRIDLib::exCellValueFormat,long(1)); EXGRIDLib::IColumnPtr var_Column1 = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Column 2"))); var_Column1->PutHTMLCaption(L"Column <b><off 2><font ;6>2"); var_Column1->PutDef(EXGRIDLib::exCellValueFormat,long(1)); EXGRIDLib::IColumnPtr var_Column2 = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Column 3"))); var_Column2->PutHTMLCaption(L"Column <b><off 2><font ;6>3"); var_Column2->PutDef(EXGRIDLib::exCellValueFormat,long(1)); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem("Item <font ;6><off 4>1"); var_Items->PutCellValue(h,long(1),"Item <font ;6><off -6>2"); var_Items->PutCellValue(h,long(2),"Item <b><font ;6><off -6>2<off 4>3<off 4>1"); |
821 |
How can I specify the splited cell's background color
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutMarkSearchColumn(VARIANT_FALSE); spGrid1->PutTreeColumnIndex(-1); ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"1")))->PutDef(EXGRIDLib::exCellBackColor,long(255)); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"2"))); var_Column->PutWidth(32); var_Column->PutAllowSizing(VARIANT_FALSE); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem("The Item's background color inherits the Column.Def(exCellBackColor)"); var_Items->PutItemDivider(h,0); h = var_Items->AddItem("The Item's background color inherits the CellBackColor()"); var_Items->PutItemDivider(h,0); var_Items->PutCellBackColor(h,vtMissing,RGB(0,255,0)); h = var_Items->AddItem("The Item's background color inherits the CellBackColor(), while the split inherits from the Column.Def(exCellBackColor) "); var_Items->PutItemDivider(h,0); var_Items->PutCellBackColor(h,vtMissing,RGB(0,255,0)); _variant_t var_SplitCell = var_Items->GetSplitCell(h,long(0)); h = var_Items->AddItem("The Item's background color inherits the CellBackColor()"); var_Items->PutItemDivider(h,0); var_Items->PutCellBackColor(h,vtMissing,RGB(0,255,0)); var_Items->PutCellBackColor(long(0),var_Items->GetSplitCell(h,long(0)),RGB(0,0,255)); |
820 |
How can I specify a fixed width for a column
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutMarkSearchColumn(VARIANT_FALSE); spGrid1->PutTreeColumnIndex(-1); spGrid1->PutColumnAutoResize(VARIANT_FALSE); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"C1"))); var_Column->PutWidth(17); var_Column->PutAllowSizing(VARIANT_FALSE); EXGRIDLib::IColumnPtr var_Column1 = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"C2"))); var_Column1->PutWidth(17); var_Column1->PutAllowSizing(VARIANT_FALSE); spGrid1->GetColumns()->Add(L"Other"); spGrid1->PutColumnAutoResize(VARIANT_TRUE); |
819 |
How can I split a cell in three parts
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutDrawGridLines(EXGRIDLib::exAllLines); spGrid1->GetColumns()->Add(L"Default"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem("entire"); h = var_Items->AddItem("split 1"); h = var_Items->GetSplitCell(h,long(0)); var_Items->PutCellValue(long(0),h,"split 2"); h = var_Items->GetSplitCell(long(0),h); var_Items->PutCellValue(long(0),h,"split 3"); h = var_Items->AddItem("entire"); spGrid1->EndUpdate(); |
818 |
How can I find if there is any filter applied to the control
// FilterChange event - Occurs when filter was changed. void OnFilterChangeGrid1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); OutputDebugStringW( L"If negative, the filter is present, else not" ); OutputDebugStringW( _bstr_t(spGrid1->GetItems()->GetVisibleItemCount()) ); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutLinesAtRoot(EXGRIDLib::exLinesAtRoot); spGrid1->PutTreeColumnIndex(-1); spGrid1->PutFilterInclude(EXGRIDLib::exMatchingItemsOnly); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Column"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutFilterType(EXGRIDLib::exFilter); var_Column->PutFilter(L"C1"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem("R1"); var_Items->InsertItem(h,vtMissing,"C1"); var_Items->InsertItem(h,vtMissing,"C2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("R2"); var_Items->InsertItem(h,vtMissing,"C1"); var_Items->InsertItem(h,vtMissing,"C2"); spGrid1->ApplyFilter(); spGrid1->EndUpdate(); |
817 |
How can I prevent showing the lines for the hierarchy while using the exMatchingItemsOnly option
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutLinesAtRoot(EXGRIDLib::exLinesAtRoot); spGrid1->PutTreeColumnIndex(-1); spGrid1->PutFilterInclude(EXGRIDLib::exMatchingItemsOnly); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Column"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutFilterType(EXGRIDLib::exFilter); var_Column->PutFilter(L"C1|C2"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem("R1"); var_Items->InsertItem(h,vtMissing,"C1"); var_Items->InsertItem(h,vtMissing,"C2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("R2"); var_Items->InsertItem(h,vtMissing,"C1"); var_Items->InsertItem(h,vtMissing,"C2"); spGrid1->ApplyFilter(); spGrid1->EndUpdate(); |
816 |
Is there any method to get only the matched items and not the items with his parent
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutLinesAtRoot(EXGRIDLib::exLinesAtRoot); spGrid1->PutFilterInclude(EXGRIDLib::exMatchingItemsOnly); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(spGrid1->GetColumns()->Add(L"Column"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutFilterType(EXGRIDLib::exFilter); var_Column->PutFilter(L"C1|C2"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); long h = var_Items->AddItem("R1"); var_Items->InsertItem(h,vtMissing,"C1"); var_Items->InsertItem(h,vtMissing,"C2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("R2"); var_Items->InsertItem(h,vtMissing,"C1"); var_Items->InsertItem(h,vtMissing,"C2"); spGrid1->ApplyFilter(); spGrid1->EndUpdate(); |
815 |
Is there any property I can save and restore automatically the current setting, column position, size, and so on (2)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->GetColumns()->Add(L"Column"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("Item 1"); var_Items->AddItem("Item 2"); var_Items->AddItem("Item 3"); spGrid1->PutLayout(L"Select=\"0\";SingleSort=\"C0:2\";Columns=1"); spGrid1->EndUpdate(); |
814 |
Is there any property I can save and restore automatically the current setting, column position, size, and so on (1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->GetColumns()->Add(L"Column"); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->AddItem("Item 1"); var_Items->AddItem("Item 2"); var_Items->AddItem("Item 3"); spGrid1->PutLayout(_bstr_t("gBjAAwAAuABmABpABsAB0ABlAByhoAPIAOEPAA9gYABoABQAgUEg0XN4AOcJicKkpujMbjsfkMFk0YhkQgUOjUEl8gjcGO0ok8KMULjEaGMcj08kQAO8oMkTNEtGwAG") + "QAqc7gUlhh1ABtAEsk9GpEfhElgVcsMupNlnlonlaAFcr0shUsp8QPEtnVJqJhmcIhUMh0QiU5sYAqMngUSuEMw07k8Qv0SgVRrNEuVflF2jF5x9JyNEm0TjQijemyE0" + "jE3t+YruauoAu4Az1qj9BzRn0UzksSnAA0xDjY6qnAw8OiUQ0dwzN0zWz2t7j8/xURAGNvWH6k8xlEhklhEI0O/6QAgI="); spGrid1->EndUpdate(); |
813 |
I have noticed that the column's header is changed once the cursor hovers it. Is it possible to change that visual appearance
|
812 |
Is it possible to change the visual appearance of the columns selector/floating bar(3)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutColumnAutoResize(VARIANT_FALSE); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); var_Columns->Add(L"Column 1"); ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Column 2")))->PutVisible(VARIANT_FALSE); spGrid1->GetVisualAppearance()->Add(2,"c:\\exontrol\\images\\normal.ebn"); spGrid1->GetVisualAppearance()->Add(3,"c:\\exontrol\\images\\pushed.ebn"); spGrid1->PutBackground(EXGRIDLib::exColumnsFloatAppearance,0x2000000); spGrid1->PutBackground(EXGRIDLib::exColumnsFloatBackColor,0x3000000); spGrid1->PutBackground(EXGRIDLib::exColumnsFloatCaptionBackColor,RGB(246,245,240)); spGrid1->PutColumnsFloatBarVisible(EXGRIDLib::exColumnsFloatBarVisibleIncludeHiddenColumns); |
811 |
Is it possible to change the visual appearance of the columns selector/floating bar(2)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutColumnAutoResize(VARIANT_FALSE); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); var_Columns->Add(L"Column 1"); ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Column 2")))->PutVisible(VARIANT_FALSE); spGrid1->GetVisualAppearance()->Add(3,"c:\\exontrol\\images\\pushed.ebn"); spGrid1->PutBackground(EXGRIDLib::exColumnsFloatBackColor,0x3000000); spGrid1->PutColumnsFloatBarVisible(EXGRIDLib::exColumnsFloatBarVisibleIncludeHiddenColumns); |
810 |
Is it possible to change the visual appearance of the columns selector/floating bar(1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->GetVisualAppearance()->Add(2,"c:\\exontrol\\images\\normal.ebn"); spGrid1->PutBackground(EXGRIDLib::exColumnsFloatAppearance,0x2000000); spGrid1->PutBackground(EXGRIDLib::exColumnsFloatBackColor,RGB(246,245,240)); spGrid1->PutBackground(EXGRIDLib::exColumnsFloatCaptionBackColor,RGB(246,245,240)); spGrid1->PutColumnsFloatBarVisible(EXGRIDLib::exColumnsFloatBarVisibleIncludeHiddenColumns); |
809 |
I am using the ColumnsFloatBarVisible property on True, but still not able to add any column on that list
|
808 |
Is it possible to list a column to columns selector/floating bar, but still user can use it
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->PutColumnAutoResize(VARIANT_FALSE); EXGRIDLib::IColumnsPtr var_Columns = spGrid1->GetColumns(); var_Columns->Add(L"Column 1"); ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Column 2")))->PutVisible(VARIANT_FALSE); EXGRIDLib::IColumnPtr var_Column = ((EXGRIDLib::IColumnPtr)(var_Columns->Add(L"Column 3"))); var_Column->PutVisible(VARIANT_FALSE); var_Column->PutEnabled(VARIANT_FALSE); spGrid1->PutColumnsFloatBarVisible(EXGRIDLib::exColumnsFloatBarVisibleIncludeHiddenColumns); |
807 |
How can I prevent a specific column not to be listed in the columns selector/floating bar
|
806 |
Is it possible to change the "Columns" caption being shown in the columns selector/floating bar
|
805 |
How can I show the columns selector, so the user can drag and drop columns to the view
|
804 |
The column's header is changed while the cursor hovers it. Is it possible to prevent that
|
803 |
I noticed that when grouping on a field, its details are always expanded. Is it possible to show collapsed by default (method 2)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExGrid\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spGrid1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spGrid1->PutSortBarVisible(VARIANT_TRUE); spGrid1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spGrid1->PutAllowGroupBy(VARIANT_TRUE); spGrid1->GetColumns()->GetItem(long(1))->PutSortOrder(EXGRIDLib::SortAscending); spGrid1->EndUpdate(); spGrid1->BeginUpdate(); spGrid1->EnsureVisibleColumn(long(0)); spGrid1->GetItems()->PutExpandItem(0,VARIANT_FALSE); spGrid1->EndUpdate(); |
802 |
I noticed that when grouping on a field, its details are always expanded. Is it possible to show collapsed by default (method 1)
// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. void OnAddGroupItemGrid1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->GetItems()->PutExpandItem(Item,VARIANT_FALSE); } EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExGrid\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spGrid1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spGrid1->PutSortBarVisible(VARIANT_TRUE); spGrid1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spGrid1->PutAllowGroupBy(VARIANT_TRUE); spGrid1->GetColumns()->GetItem(long(1))->PutSortOrder(EXGRIDLib::SortAscending); spGrid1->EndUpdate(); |
801 |
Is there a possibility to expand / collapse all groups (or group by group) at runtime with a method (equivalent to pressing the + or - button in the group header)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGRIDLib' for the library: 'ExGrid 1.0 Control Library' #import <ExGrid.dll> using namespace EXGRIDLib; */ EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); spGrid1->BeginUpdate(); spGrid1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExGrid\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spGrid1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spGrid1->PutSortBarVisible(VARIANT_TRUE); spGrid1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spGrid1->PutAllowGroupBy(VARIANT_TRUE); spGrid1->GetColumns()->GetItem(long(1))->PutSortOrder(EXGRIDLib::SortAscending); spGrid1->EndUpdate(); spGrid1->EnsureVisibleColumn(long(0)); spGrid1->BeginUpdate(); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutExpandItem(var_Items->GetRootItem(0),VARIANT_FALSE); var_Items->PutExpandItem(var_Items->GetRootItem(1),VARIANT_FALSE); var_Items->PutExpandItem(var_Items->GetRootItem(2),VARIANT_FALSE); spGrid1->EndUpdate(); |